<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>商品品牌列表</title>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<#include "../template/include/assign.ftl">
<#include "../template/include/source.ftl">
<#include "../template/template_listPage.ftl">
<link href="${web_static}/admin/css/list.css" rel="stylesheet" type="text/css" />
<style type="text/css">
	.page{
		float:right;
		padding-top: 15px;
		margin-right: 15px;
	}
</style>
<script type="text/javascript">
$(document).ready(function(){
  $('#searchButton').click( 
  	function () { 
  		$('#currentPage_listForm').val('1');
  	}  	
  	);
  	
  	$('#isDelete').val('<#if goodsBrandQuery??>${(goodsBrandQuery.isDelete)!}</#if>');
    $('#heat').val('<#if goodsBrandQuery??>${(goodsBrandQuery.heat)!}</#if>');

    <#if actionErrors??&&(actionErrors?size > 0)>
        $.dialog({type: "warn", content: "<#list errorMessages as list>${list}<br></#list>",
            modal: true, autoCloseTime: 3000});
    </#if>
    });

function deleteBrand(id){
	 var result = confirm("你确认要删除吗?");
	 if (result) {
		var url="${web_base}/game/goods_brand!delete.htm?id="+id;
		document.forms[0].action=url;
		document.forms[0].submit();
	}
	}

	function editBrand(goodsCategoryId) {
            var brandId = $('#goodsCategoryId').val();
            var brandName = $('#gameName').val();
            var url = "${web_base}/game/goods_brand!toEdit.htm?goodsCategoryId=" + goodsCategoryId;
            if (brandId != null && brandId != '') {
                url = url + "&brandId=" + brandId;
            }
            if(brandName != null && brandName != ''){
                url = url + "&brandName=" + brandName;
            }
            document.forms[0].action = encodeURI(url);
            document.forms[0].submit();
        }

</script>
</head>
<body class="list">
	<div class="body">
		<div class="listBar">
			<h1><span class="icon">&nbsp;</span>品牌管理&nbsp;<span class="pageInfo"></span></h1>
		</div>
		<@pageList page=(page!) id="listForm" action="${web_base}/game/goods_brand!brandList.htm" query="goodsBrandQuery" isEmpty=true>
			<div class="operateBar">
				<input type="button" class="addButton" onclick="location.href='${web_base}/game/goods_brand!add.htm'" value="添加品牌" />
					<label>查找:</label>
					商品品牌编号：<input type="text" id="goodsCategoryId" name="goodsBrandQuery.goodsCategoryId"  value="<#if goodsBrandQuery??>${(goodsBrandQuery.goodsCategoryId)!}</#if>" />
					商品品牌名称：<input type="text" id="gameName" name="goodsBrandQuery.gameName"  value="<#if goodsBrandQuery??>${(goodsBrandQuery.gameName)!}</#if>" />
                    热度选择：<select name="goodsBrandQuery.heat" id="heat">
                <option value="">请选择...</option>
                <option value=2>
                    热门
                </option>
                <option value=1>
                    一般
                </option>
            </select>
					是否删除：
					<select name="goodsBrandQuery.isDelete" id="isDelete">
						 		<option value="0" >
									删除
								</option>
								<option value="1" >
									未删除
								</option>
							</select>
					<input type="submit" id="searchButton" class="searchButton" value="" />
			</div>
			<table class="listTable">
				<tr>
					<th>
						<span class="sort" name="goodsCategoryId">商品品牌编号</span>
					</th>
					<th>
						<span class="sort" name="gameName">商品品牌名称</span>
					</th>
                    <th>
                        <span class="sort" name="heat">热度</span>
                    </th>
                    <th>
                        <span class="sort" name="insertTime">录入时间</span>
                    </th>
                    <th>
                        <span class="sort" name="modifyTime">修改时间</span>
                    </th>
					<th>
						<span  name="operator">操作员</span>
					</th>
					<th width="120" align="center">&nbsp;&nbsp;操&nbsp;&nbsp;&nbsp;&nbsp;作<th/>
				</tr>

            <#if page?? && page.list?? && (page.list?size gt 0)>
				<#list page.list as obj>
					<tr>
						<td>
							${(obj.goodsCategoryId)!}
						</td>
						<td>
                            <#if obj.gameName?? && obj.gameName?length gte 30>
                            <#--//截取输出文字的长度-->
                                ${obj.gameName?substring(0,30)}...
                            <#else>
                                ${(obj.gameName)!}
                            </#if>
						</td>
                        <td>
                            <#if obj?? && obj.heat?? && obj.heat==2>
                                热门
                            <#elseif  obj?? && obj.heat?? && obj.heat==1>
                                一般
                            </#if>

                        </td>
						<td>
							${(obj.insertTime)!}
						</td>
                        <td>
                             ${(obj.modifyTime)!}
                        </td>
                        <td>
                             ${(obj.operator)!}
                        </td>
						<td width="120">
                            <a href="${web_base}/game/goods_brand!detail.htm?goodsCategoryId=${(obj.goodsCategoryId)!}" title="详情">[详情]</a>
                            <#if obj.isDelete?? && obj.isDelete=="1">
							 <span class="spanLink" onclick="editBrand('${(obj.goodsCategoryId)!}');" title="编辑">[编辑]</span>
                            <#else >
                            </#if>
                        <#if obj.isDelete?? && obj.isDelete=="1">
							<span class="spanLink" onclick="deleteBrand('${(obj.id)!}');" title="删除">[删除]</span>
                        <#else>
                            [删除]
                        </#if>
						</td>
					</tr>
				</#list>
				</#if>
			</table>
			
			<#if page?? && page.list?? && (page.list?size <= 0)>
				<div class="noRecord">
					没有找到任何记录!
				</div>
			</#if>
		</@pageList>
	</div>
	
</body>
</html>